#include "StdAfx.h"
#include <Application>
#include <MainWindow>

Application::Application(int& argc, char** argv)
	: QApplication(argc, argv)
{
	
}

Application::~Application()
{

}

bool Application::initInstance()
{
	m_mainWindow = new MainWindow;
	m_mainWindow->show();
	return true;
}

void Application::exitInstance()
{
	
}

Application& Application::instance()
{
	Application* pInst = dynamic_cast<Application*>(QCoreApplication::instance());
	Q_ASSERT(pInst);
	return *pInst;
}

QPointer<View> Application::activeView() const
{
	Q_ASSERT(m_mainWindow);
	return m_mainWindow->activeView();
}

QPointer<Document> Application::activeDocument() const
{
	Q_ASSERT(m_mainWindow);
	return m_mainWindow->activeDocument();
}
